home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 52
/
Aminet 52 (2002)(GTI - Schatztruhe)[!][Dec 2002].iso
/
Aminet
/
dev
/
c
/
tox.lha
/
tox
/
tox.h
< prev
next >
Wrap
C/C++ Source or Header
|
2002-10-20
|
4KB
|
130 lines
/*-------------------------------------------------------------------------
* tox - an XML tokenizer
*
* Copyright (c) 2000 Eckhart Köppen
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*-----------------------------------------------------------------------*/
/* $Id: tox.h,v 1.11 2002/05/01 03:14:34 koeppen Exp $ */
#ifndef __TOX_H
#define __TOX_H
#ifdef __cplusplus
extern "C" {
#endif
struct _parser_state;
typedef void (callback)(struct _parser_state *);
typedef struct _parser_state
{
char *text;
int current;
int maxtext;
int char_width;
int swap_bytes;
int state;
char pump;
char *buffer;
int bcurrent;
int maxbuf;
int squoteLevel;
int dquoteLevel;
int angleBracketLevel;
callback *element_callback;
callback *attrname_callback;
callback *attrval_callback;
callback *word_callback;
callback *ws_callback;
void *userdata;
} parser_state;
#define STATE_ERROR -2
#define STATE_END -1
#define STATE_CONTENT 0
#define STATE_STARTTAG_START 1
#define STATE_REF_START 2
#define STATE_CHARDATA 3
#define STATE_ENDTAG_START 4
#define STATE_STARTTAG_NAME 5
#define STATE_REF_NAME 6
#define STATE_ENDTAG_NAME 7
#define STATE_STARTTAG_NAMEEND 8
#define STATE_ENDTAG_NAMEEND 9
#define STATE_ATTR_NAME 10
#define STATE_ATTR_NAMEEND 11
#define STATE_ATTR_VALSTART 12
#define STATE_ATTR_VALDQUOT 13
#define STATE_EMPTYTAG_END 14
#define STATE_ATTR_VALDQUOT_REF 15
#define STATE_ATTR_VDQ_REFNAME 16
#define STATE_ATTR_VALSQUOT 17
#define STATE_ATTR_VALSQUOT_REF 18
#define STATE_ATTR_VSQ_REFNAME 19
#define STATE_DTD_START 20
#define STATE_MARKUPDECL_START 21
#define STATE_CDATA 22
#define STATE_CDATA_1ST_BRACKET 23
#define STATE_CDATA_2ND_BRACKET 24
#define STATE_PI 25
#define STATE_PI_END_QMARK 26
#define STATE_COMMENT 27
#define STATE_COMMENT_1ST_DASH 28
#define STATE_COMMENT_2ND_DASH 29
#define STATE_REF_NUMBER 30
#define STATE_REF_HEX_NUMBER_1 31
#define STATE_REF_HEX_NUMBER 32
#define STATE_REF_DEC_NUMBER 33
#define STATE_WS_CONTENT 34
#define STATE_WORD_CONTENT 35
#define STATE_COMMENT_START_1ST 36
#define STATE_DOCTYPE_D 37
#define STATE_DOCTYPE_O 38
#define STATE_DOCTYPE_C 39
#define STATE_DOCTYPE_T 40
#define STATE_DOCTYPE_Y 41
#define STATE_DOCTYPE_P 42
#define STATE_CDATA_BRACKET 43
#define STATE_CDATA_C 44
#define STATE_CDATA_D 45
#define STATE_CDATA_A 46
#define STATE_CDATA_T 47
#define STATE_CDATA_A2 48
void tox_parse (parser_state *parser);
#ifdef __cplusplus
}
#endif
#endif
/*
* Local variables:
* c-basic-offset: 4
* tab-width: 4
* End:
*/